package com.leetcode.algorithm.y22.m06;

/**
 * 1523. 在区间范围内统计奇数数目
 * 
 * https://leetcode.cn/problems/count-odd-numbers-in-an-interval-range/
 * 
 * @author jie.deng
 *
 */
class Question1523Solution01 {
	
	public int countOdds(int low, int high) {
		int size = high - low + 1;
		return (size & 1) == 0 ? (size >> 1) : ((low & 1) == 1 ? 1 : 0) + (size >> 1);
	}
	
}